package vip.xiaonuo.core.enums;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * ClassName: IFDELENUM
 *
 * @Description: 是否启用
 **/
public enum IFDELENUM {
    //停用
    UNUSEFUL("0", "停用"),
    //启用
    USEFUL("1", "启用");

    private String name;
    private String value;

    IFDELENUM(String value, String name) {
        this.name = name;
        this.value = value;
    }

    public String getName() {
        return name;
    }

    public String getValue() {
        return value;
    }

    public static List<Map<String, String>> toList() {
        List<Map<String, String>> list = new ArrayList<Map<String, String>>();
        for (IFDELENUM item : IFDELENUM.values()) {
            Map<String, String> map = new HashMap<String, String>();
            map.put("value", item.getValue());
            map.put("name", item.getName());
            list.add(map);
        }
        return list;
    }

    public static Map<String, String> toMap() {
        Map<String, String> map = new HashMap<String, String>();
        for (IFDELENUM item : IFDELENUM.values()) {
            map.put(item.getValue(), item.getName());
        }
        return map;
    }

    public static List<String> toStringList() {
        List<String> list = new ArrayList<String>();
        for (IFDELENUM item : IFDELENUM.values()) {
            list.add(item.getValue());
        }
        return list;
    }
}
